/***********************************************************
* 
*     File Name:  pointtest.cpp
* 
*        Author:  Algolc
* 
*          mail:  17360224@qq.com
* 
*  Created Time:  Tue 15 May 2018 10:12:04 AM CST
* 
***********************************************************/

#include <stdlib.h>
#include <stdio.h>

int pointfun(int** a)
{
    int b = 5;
    *a = &b;
    return 0;
}
int main(int argc, char** argv)
{
    int *a;
    pointfun(&a);

    printf("%d", *a);
    return 0;
}

#if 0 //错误代码
int pointfun(int* a)
{
    int b = 5;
    a = &b;

    return 0;
}

int main(int argc, char** argv)
{
    int *a;
    pointfun(a);

    printf("%d", *a);
}
#endif
